<template>
  <div class="comicCellPageSubject">
    <div class="comicCellPageHeader">
      <van-icon name="arrow-left" @click="returnPage" />
      <font>{{ pageName }}</font>
    </div>
    <div class="comicCellPageMain">
      <div v-for="(item, index) in comicList" :key="index">
        <div class="img">
          <img :src="item.imgPath" alt="" @click="toComicInfo(index)" />
        </div>
        <font class="title" @click="toComicInfo(index)">{{ item.name }}</font>
        <font class="chapter"
          >第 <font>{{ item.chapter }}</font> 章</font
        >
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      pageName: '',
      comicList: []
    };
  },
  created () {
    var distinguish = this.$route.query.distinguish;
    var pageName = this.$route.query.pageName;
    this.pageName = pageName;
    var list = [
      { name: '斗罗大陆222222222222', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' },
      { name: '斗罗大陆', imgPath: 'http://mhfm7tel.cdndm5.com/42/41679/20200409101850_180x240_21.jpg', chapter: '106' }
    ];
    this.comicList = list;
  },
  methods: {
    returnPage () {
      this.$router.go(-1);
    },
    toComicInfo (value) {
      this.$router.push({
        path: '/comicInfo',
        query: {
          id: value
        }

      });
    }
  }
};
</script>

<style lang="less" scoped>
.comicCellPageSubject {
  width: 100%;
  height: 100%;
  background-color: #a7a7a7;
  display: flex;
  flex-direction: column;
}

.comicCellPageSubject .comicCellPageHeader {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  i {
    font-size: 30px;
  }
  font {
    font-size: 20px;
    font-weight: bold;
  }
}
.comicCellPageSubject .comicCellPageMain {
  flex: 1;
  width: 100%;
  background-color: #ffffff;
  overflow: auto;
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  div {
    width: 120px;
    height: 210px;
    float: left;
    background-color: #ffffff;
    margin-top: 4px;
    margin-right: 1px;
    margin-left: 3px;
    box-sizing: border-box;
    .img {
      width: 100%;
      margin: 0;
      height: 160px;
      overflow: hidden;
      img {
        width: 100%;
      }
    }

    .title {
      display: block;
      text-align: center;
      padding-left: 3px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 16px;
      font-weight: bold;
    }
    .chapter {
      display: block;
      text-align: center;
      margin-left: 3px;
      margin-top: 2px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 14px;
      color: #a7a7a7;
      font {
        color: red;
      }
    }
  }
}
</style>
